import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home.vue'
import duoduovideo from '../views/duoduovideo.vue'
import type from '../views/type.vue'
import chat from '../views/chat.vue'
import self from '../views/self.vue'
import Listf from '@/components/home/listf.vue'
import Listl from '@/components/home/listl.vue'
import goodslist from '@/components/type/goodslist.vue'
import goodsinfo from '@/components/type/goodsinfo.vue'
import gouwuche from '@/components/gouwuche.vue'
Vue.use(VueRouter)

const routes = [{
        path: '/home',
        name: 'home',
        component: home,
        children: [{
            path: "listf",
            name: "listf",
            component: Listf
        }, {
            path: "listl",
            name: "listl",
            component: Listl
        }, {
            path: "/",
            redirect: '/home/listf'
        }]
    },
    {
        path: '/duoduovideo',
        name: 'duoduovideo',
        component: duoduovideo
    },
    {
        path: '/type',
        name: 'type',
        component: type,
    },
    {
        path: '/chat',
        name: 'chat',
        component: chat
    },
    {
        path: '/self',
        name: 'self',
        component: self
    },
    {
        path: '/goodslist',
        name: 'goodslist',
        component: goodslist
    },
    {
        path: '/goodsinfo',
        name: 'goodsinfo',
        component: goodsinfo
    },
    {
        path: '/gouwuche',
        name: 'gouwuche',
        component: gouwuche
    },
    {
        path: '/',
        redirect: "/home"
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router